import reuquest from '@/utils/request.js'

// 产品租赁价与档期
export const userAgentOrderProductDateApi = (data = {}, options = { loading: false }) => {
	return reuquest.get('/apiapp/v1/rent_order/product_date', data, options)
}

// 租赁结算单
export const userAgentOrderConfirmApi = (data = {}, options = { loading: false }) => {
	return reuquest.post('/apiapp/v1/rent_order/confirm', data, options)
}

// 租赁下单
export const userAgentOrderCreateApi = (data = {}, options = { loading: false }) => {
	return reuquest.post('/apiapp/v1/rent_order/create', data, options)
}

// 订单状态数据
export const userAgentOrderStatusDataApi = (data = {}, options = { loading: false }) => {
	return reuquest.get('/apiapp/v1/rent_order/order_status_data', data, options)
}

// 订单列表
export const userAgentOrderListApi = (data = {}, options = { loading: false }) => {
	return reuquest.get('/apiapp/v1/rent_order/list', data, options)
}

// 订单详情
export const userAgentOrderDetailsApi = (id, data = {}, options = { loading: false }) => {
	return reuquest.get(`/apiapp/v1/rent_order/details?gid=${id}`, data, options)
}

// 订单删除
export const userAgentOrderDeleteApi = (id, data = {}, options = { loading: true }) => {
	return reuquest.post(`/apiapp/v1/rent_order/delete?gid=${id}`, data, options)
}

// 订单取消（并退款）
export const userAgentOrderCancelApi = (id, data = {}, options = { loading: true }) => {
	return reuquest.post(`/apiapp/v1/rent_order/cancel?gid=${id}`, data, options)
}

// 订单支付
export const userAgentOrderPaymentApi = (data = {}, options = { loading: true }) => {
	return reuquest.get('/apiapp/v1/pay/create', data, options)
}
